package flex.cc.wechat;

import flex.cc.common.utils.HttpClientUtil;

public class Test {
	public static void main(String[] args) {
		HttpClientUtil httpUtil=HttpClientUtil.getInstance();
		/*String appId="wxf0d8abe3691cdf84";
		String appsecret="dc704dfa849ee47285e65c42870e7b82";
		String url="https://api.weixin.qq.com/sns/oauth2/access_token?"
				+ "appid="+appId
				+ "&secret="+appsecret
				+ "&code=001Z5o000ZIkKM1Wlc400usS2t4Z5o02"
				+ "&grant_type=authorization_code";
		System.out.println(url);
		String res=httpUtil.sendHttpGet(url);
		JSONObject json=JSON.parseObject(res);
		System.out.println("响应内容："+res);
		System.out.println("OPID："+json.getString("openid"));*/
		
		/*String appId="wx43b25f1f749effc7";
		String appsecret="8afde4f8b36e63153869b5e07a23fe2f";
		System.out.println(WechatUtil.getAccessToken(appId, appsecret));
		System.out.println(WechatUtil.getAccessToken(appId, appsecret));*/
		
		/*WechatMenus menus=new WechatMenus();
		ClickButton menu1=new ClickButton();
		menu1.setName("菜单一");
		menu1.setType("click");
		menu1.setKey("m_1");
		ViewButton menu2=new ViewButton();
		menu2.setType("view");
		menu2.setName("菜单二");
		menu2.setUrl("www.baidul.com");
		SubMenu menu3=new SubMenu("多级菜单");
		SubButton b1=new SubButton();
		b1.setType("pic_photo_or_album");
		b1.setName("传图");
		b1.setKey("m_3_1");
		ClickButton b2=new ClickButton();
		b2.setType("location_select");
		b2.setName("位置");
		b2.setKey("m_3_2");
		SubButton b3=new SubButton();
		b3.setType("scancode_push");
		b3.setName("扫码推");
		b3.setKey("m_3_3");
		SubButton b4=new SubButton();
		b4.setType("scancode_waitmsg");
		b4.setName("扫码带提示");
		b4.setKey("m_3_4");
		menu3.getSub_button().add(b1);
		menu3.getSub_button().add(b2);
		menu3.getSub_button().add(b3);
		menu3.getSub_button().add(b4);
		menus.getButton().add(menu1);
		menus.getButton().add(menu2);
		menus.getButton().add(menu3);
		System.out.println(JSON.toJSONString(menus));*/
		
		String appId="wx43b25f1f749effc7";
		String appsecret="8afde4f8b36e63153869b5e07a23fe2f";
		//String token=WechatUtil.getAccessToken(appId, appsecret);
		/*String response=httpUtil.sendHttpGet("https://api.weixin.qq.com/cgi-bin/menu/delete?access_token="+token);
		System.out.println(response);*/
		//WechatUtil.createMenu(token);
	}
}
